import axios from 'axios'

const api = axios.create({
  baseURL: '/oneDimension',
  timeout: 5000
})

// 零件相关接口
export const partAPI = {
  add: (data) => api.post('/part/add', data),
  delete: (data) => api.delete('/part/delete', { data }),
  update: (data) => api.put('/part/update', data)
}

// 原料相关接口
export const rawAPI = {
  add: (data) => api.post('/raw/add', data),
  delete: (data) => api.delete('/raw/delete', { data }),
  update: (data) => api.put('/raw/update', data)
}

// 排样接口
export const patternAPI = {
  get: () => api.get('/getPattern')
}